package com.abigdreamer.io;

import java.io.File;

public class FileUtil
{
  public static void deleteDirectory(File directory)
  {
    if ((directory != null) && (directory.exists()) && (directory.isDirectory())) {
      for (File file : directory.listFiles()) {
        if (file.isDirectory()) {
          deleteDirectory(file);
        } else {
          file.delete();
        }
      }
    }
    directory.delete();
  }
}
